
from mqttdemo.mqtt1.mqttutil import MqttUtil

# 创建 MqttUtil 实例并发送消息
mqtt_client = MqttUtil("localhost", client_id="PublisherClient")
mqtt_client.connect()
mqtt_client.publish("test/topic", "Hello, MQTT!")
mqtt_client.disconnect()
